<div id="pagination">
<div id="quickpages">
  		<span>Chuyển nhanh:</span><select onchange="changePage(this.value);">
  		<?php
  		 foreach ($this->pagesInRange as $page){
  		 	if($page == $this->current)
   				echo "<option value='".$page."' selected='selected'>".$page."</option>";
			else echo "<option value='".$page."'>".$page."</option>";
   				
   		} 
  		?>	
  		</select>
  		<script type="text/javascript">
  		function changePage(page){
  	  		var url = location.href;
  	  		var reg = new RegExp("_p[0-9]+.html");
  	  		if(reg.test(url)) url = url.replace(reg, "_p"+page+".html");
  	  		location.href=url;
  		}
  		</script>
	</div>
	<div id="pages">
		<span>Trang: </span>
<?php 
    if (isset($this->previous)){
	    if(isset($this->first)){
			//echo "<a href='".$this->url(array('page'=>'_p'.$this->first, 'cat_name' => Helper_Converter::stringToSlug($this->pCategory->name), 'cat_id' => $this->pCategory->id), 'pcategory')."'>&laquo;</a>";
		}
         echo "<a href='".$this->url(array('page'=>'_p'.$this->previous, 'cat_name' => Helper_Converter::stringToSlug($this->pCategory->name), 'cat_id' => $this->pCategory->id), 'pcategory')."'>[Trước]</a>";
    }
    foreach ($this->pagesInRange as $page){
       if ($page != $this->current){
               echo  "<a href='".$this->url(array('page'=>'_p'.$page, 'cat_name' => Helper_Converter::stringToSlug($this->pCategory->name), 'cat_id' => $this->pCategory->id), 'pcategory')."'>[" . $page . "]</a>";
      }else{
          echo "<span>".$page . "</span>";
      }
   }
   if (isset($this->next)){
   		echo "<a href='".$this->url(array('page'=>'_p'.$this->next, 'cat_name' => Helper_Converter::stringToSlug($this->pCategory->name), 'cat_id' => $this->pCategory->id), 'pcategory')."'>[Sau]</a>";
	   if (isset($this->last)){
	   		//echo "<a href='".$this->url(array('page'=>'_p'.$this->last, 'cat_name' => Helper_Converter::stringToSlug($this->pCategory->name), 'cat_id' => $this->pCategory->id), 'pcategory')."'>&raquo;</a>";
	   }
   }
   
  ?>
  </div>
</div>